import json

from django.http import HttpResponse

# Create your views here.
from china_regions.models import City, Country, Province


def countrys(request, id):
    # # 根据传递的省的id 查找数据库中该省的城市
    # citys = Country.objects.filter(city_id=id)
    # result = []
    # for i in citys:
    #     # 对应的id和城市名称组成一个字典
    #     result.append({'id': i.id, 'name': i.name})
    # # 返回json数据
    # return HttpResponse(json.dumps(result), content_type="application/json")
    pass


def citys(request, id):
    # # 根据传递的省的id 查找数据库中该省的城市
    # citys = City.objects.filter(province_id=id)
    # result = []
    # for i in citys:
    #     # 对应的id和城市名称组成一个字典
    #     result.append({'id': i.id, 'name': i.name})
    # # 返回json数据
    # return HttpResponse(json.dumps(result), content_type="application/json")
    pass

